﻿Public Class CowLife

    Dim vLife As Integer

    Public Property Life() As Integer
        Get
            Return vLife
        End Get
        Set(ByVal value As Integer)
            vLife = value
            If (value >= 1) Then
                LabelLife.Text = value
            End If
        End Set
    End Property

    Public Overloads Sub DecreaseLife(ByVal value As Integer)
        Life -= value
        If (Life <= 0) Then
            GameOver()
        End If
    End Sub

    Public Overloads Sub DecreaseLife()
        DecreaseLife(1)
    End Sub

    Public Sub GameOver()
        ParentForm.Close()
        LoseAnnouncement.Show()
    End Sub

    Private Sub CowLife_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

End Class
